import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/sensorLog',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/sensorLog/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/sensorLog',
    method: 'put',
    data
  })
}

export function charts(params) {
  return request({
    url: 'api/sensorLog/charts',
    method: 'get',
    params
  })
}

// 环境日志
export function searchIdSensorLogAPI (id, type = '') {
  return request({
    url: `api/sensorLog`,
    method: 'get',
    params: {
      id,
      type
    }
  })
}
// 环境日志删除
export function SensorLogDelAPI (data) {
  return request({
    url: `api/sensor/delete`,
    method: 'post',
    data
  })
}
export default { add, edit, del }
